﻿<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="newmemberregister.aspx.cs" Inherits="Login_newmemberregister" Title="Register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div class="sectiontitle">Create your new account</div>
            <p></p>
            <table cellpadding="2">
               <tr>
                  <td style="width: 110px;" class="fieldname"><asp:Label runat="server" ID="lblUserName" AssociatedControlID="UserName" Text="Username:" /></td>
                  <td style="width: 300px;"><asp:TextBox runat="server" ID="UserName" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireUserName" runat="server" ControlToValidate="UserName" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="Username is required." ToolTip="Username is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                  </td>            
               </tr>               
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblPassword" AssociatedControlID="Password" Text="Password:" /></td>
                  <td><asp:TextBox runat="server" ID="Password" TextMode="Password" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequirePassword" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <asp:RegularExpressionValidator ID="valPasswordLength" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
                        ValidationExpression="\w{5,}" ErrorMessage="Password must be at least 5 characters long." ToolTip="Password must be at least 5 characters long."
                        ValidationGroup="CreateUserWizard1">*</asp:RegularExpressionValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblConfirmPassword" AssociatedControlID="ConfirmPassword" Text="Confirm password:" /></td>
                  <td><asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireConfirmPassword" runat="server" ControlToValidate="ConfirmPassword" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <asp:CompareValidator ID="valComparePasswords" runat="server" ControlToCompare="Password" SetFocusOnError="true"
                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                        ValidationGroup="CreateUserWizard1">*</asp:CompareValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblEmail" AssociatedControlID="Email" Text="E-mail:" /></td>
                  <td><asp:TextBox runat="server" ID="Email" Width="100%" Text='<%# Email %>' /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireEmail" runat="server" ControlToValidate="Email" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <asp:RegularExpressionValidator runat="server" ID="valEmailPattern"  Display="Dynamic" SetFocusOnError="true" ValidationGroup="CreateUserWizard1"
                        ControlToValidate="Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorMessage="The e-mail address you specified is not well-formed.">*</asp:RegularExpressionValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblQuestion" AssociatedControlID="Question" Text="Security question:" /></td>
                  <td><asp:TextBox runat="server" ID="Question" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireQuestion" runat="server" ControlToValidate="Question" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="Security question is required." ToolTip="Security question is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblAnswer" AssociatedControlID="Answer" Text="Security answer:" /></td>
                  <td><asp:TextBox runat="server" ID="Answer" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireAnswer" runat="server" ControlToValidate="Answer" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="Security answer is required." ToolTip="Security answer is required."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                  </td>            
               </tr>
               <tr>
                  <td colspan="3" style="text-align: right;">
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator_email" runat="server" 
                          ControlToValidate="Email" ErrorMessage="Email can't be empty"></asp:RequiredFieldValidator>
                     <asp:Label ID="ErrorMessage" SkinID="FeedbackKO" runat="server" EnableViewState="False"></asp:Label>
                  </td>
               </tr>
               <tr>
                  <td colspan="3" style="text-align: right;">
                   <asp:Button ID="Button1"  runat="server" BorderStyle="Solid" Text="Create" 
                          onclick="Button1_Click" />
                </td>
               </tr>
            </table>
</asp:Content>
